  <? if(!empty($student_grades)) :?>
<table class="table table-bordered">
		<tr class="info">
			<td>Subject Code</td>
			<? if(!empty($grading_periods)) :?>
			<? foreach($grading_periods as $row) :?>
			<td><?= $row->gp_desc ;?></td>
			<? endforeach ;?>
			<? endif ;?>
		</tr>
		<tbody class="tabular">

  <? foreach($student_grades as $row) :?>
			<tr>
				<td style="background:#c0c0c0;font-weight:bold;"><?= $row->subj_code ;?></td>
				<? foreach($grades as $r) :?>
				<? if($r->subject_id == $row->subj_id) :?>
				<td><?=_convert($r->value)?></td>
				<? endif ;?>
				<? endforeach ;?>
			</tr>
		<? endforeach ;?>

  </tbody>
</table>
  <? else: ?>
		<code>
			Unable to get student grades because student is not assigned to a section.
		</code>
  <? endif;?>


